<template>
  <div @click="father">
    <h1>v-on练习</h1>
    <!-- 
      事件修饰符的语法
      @click.修饰符 = "函数"
        .prevent 阻止默认行为
        .stop    阻止冒泡

      按键修饰符
        .enter
        .esc
     -->
    <a href="http://www.baidu.com" @click.prevent.stop="fn">百度一下</a>

    <a href="http://www.baidu.com" @click.prevent>哈哈哈</a>

    <input type="text" placeholder="请输入内容" @keydown.esc="fn1">
  </div>
  
</template>

<script>
export default {
  data () {
    return {
      money: 1000
    }
  },
  methods: {
    fn () {
      console.log('哈哈哈')
    },
    father () {
      console.log('我是father事件')
    },
    fn1 () {
      console.log('我触发了')
    }
  }
}
</script>

<style>

</style>